﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 构造器
{
    public class Car
    {
        public readonly IEngine _engine;
        public Car(IEngine engine)
        {
            this._engine = engine;
        }
        public void Drive()
        {
            _engine.Start();
            Debug.WriteLine("Car is driving.");
        }

    }
}
